1. Field of the Invention
This invention relates generally to the field of computer memory systems and in particular to a memory management system for control and optimization of computer memory use.
2. Background Art
A typical computer system consists of a number of modules or components. Computer systems typically include a central processing unit (CPU) such as a microprocessor. The microprocessor is a program-controlled device that obtains, decodes and executes instructions. A computer system also includes storage components for storing system operating software, application program instructions and data. These storage components may be read only memory (ROM), random access memory (RAM), disk or tape storage, or any other suitable storage means.
A computer system typically also includes input/output (I/O) components for connecting external devices to the microprocessor. Special purpose components, such as memory management units or co-processors, may also be part of the computer system.
Computers are used to process data. To allow processing of data, input data must be stored until it is to be used by the central processing unit (CPU). Also, output data must be stored after it has been processed. During some processing operations, the CPU may also require the storage of data temporarily while instructions are executed on that data. In addition, the application program that controls the processing and the operating system under which the program runs must be accessible to the CPU. This information is made available to the CPU by storing it in a resource known as "main memory".
The memory component known as main memory is a scarce resource that is dynamically allocated to users, data, programs or processes. Main memory is typically a silicon-based memory such as a RAM. In many applications, dynamic random access memory (DRAM) is used as the main memory. Processor main memory is "byte" organized. That is, memory is arranged as a sequence of 8-bit bytes and the byte is the smallest unit of information accessed out of the memory. In one convention, an entire row is selected by a row address and columns are accessed in groups of 8 bits. In some implementations, 16-bit words (2 bytes) or 32-bit words (4 bytes) are accessed at one time.
In order for the main memory to be accessible to the CPU, it must be connected either directly or indirectly to the CPU. The amount of main memory which can be connected directly to the central processing unit is limited by the width of the CPU's address bus. The address bus is connected between the CPU and memory. To access memory, the CPU may place a value on the address bus which uniquely represents a single memory location. The number of unique values which may be placed on the address bus depends upon the width of the address bus. Since the width of the address bus for a particular type of CPU, such as a particular microprocessor, is usually fixed, the number of memory locations which are addressable by the CPU is limited.
Sometimes it is desirable to connect more memory to a CPU than can be addressed by the CPU. To allow the connection of additional memory, a method is used to indirectly couple additional memory to the CPU. Microprocessors such as the 8088 and 8086 have a 20-bit address bus. Since the number of memory locations addressable by an n-bit address bus 2.sup.n, the number of memory locations addressable by a 20-bit address bus is 2.sup.20, which is equal to approximately one million (1M). In order to be directly accessible to the CPU, all memory must be located within a contiguous block of a size no greater than the number of unique values which may be represented by the bits of the address bus. With a 20-bit address bus, all memory must lie within a contiguous 1M block.
Although it is theoretically possible to access additional memory by some indirect method, most operating systems support only direct access to memory. If the operating system does not support indirect methods for accessing additional memory, an application program and all of its data, along with all necessary system software, must be contained within the contiguous directly accessible block.
While the width of the address bus limits the amount of directly accessible memory, the amount of memory occupied by the system software limits the amount of free memory for application programs to use. Thus, the amount of memory available for application programs will be less than the total amount which is directly accessible. When application programs require more memory than is available for them, a method must be found found for increasing the amount of easily accessible memory available.
In the prior art, a number of attempts have been made to increase the amount of available memory. One method used in the prior art is known as expanded memory specification (EMS). EMS divides a pool of memory which is not directly accessible, known as expanded memory, into pages. By switching the expanded memory one page at a time into the address space which is directly accessible by the CPU, EMS is able to access a virtually unlimited amount of memory. However, EMS takes time to change pages. If the desired data is not in the EMS page frame located in directly accessible memory, EMS must page out the current contents of the page frame and page in the page from expanded memory which contains the desired data. Since such a page change requires time, the processing speed of the computer is reduced. Also, EMS is not generally applicable to all application software. Application software must be written specifically to take advantage of EMS if it is available.
Another method used in the prior art relies on the LOADALL instruction. The LOADALL instruction is an unsupported instruction which is implemented only on the 80286 microprocessor. Since the LOADALL instruction is implemented only on the 80286, this prior art method is only useful in computers based on the 80286 microprocessor.
Another method of the prior art involves the examination and reprogramming of the system software contained on the system ROM. Under this method, the system ROM can be reprogrammed to perform its function while occupying a minimum amount of memory. This method allows the memory space that was wasted because of inefficient ROM programming to be used for other purposes. However, this method requires manual reprogramming of each revision of each ROM with which the method can be used.
All of these prior art methods have disadvantages. Some of these methods provide additional memory, but result in degraded performance of the computer system because of the steps required to make the desired data accessible. Other methods are useful only on systems based on a particular central processing unit. Some methods are ROM-specific and must be separately implemented for each revision of each ROM. Other methods are specific to particular applications programs and cannot be generally applied to all application software.